#include <time.h>
#include <stdio.h>

void print_time() {
	time_t timetemp;
	char *wday[] = {"星期日", "星期一", "星期二", "Wed", "Thu", "Fri", "Sat"};
	struct tm *p;
	time(&timetemp);
	p = gmtime(&timetemp);
	char *timestr = asctime(p);
	printf("%s", timestr);

	time_t now ;
    struct tm *tm_now ;
    time(&now) ;
    tm_now = localtime(&now) ;
    printf("now datetime: %s %d-%d-%d %d:%d:%d\n",  \
			wday[tm_now->tm_wday],\
			tm_now->tm_year+1900, \
			tm_now->tm_mon+1, \
			tm_now->tm_mday, \
			tm_now->tm_hour, \
			tm_now->tm_min, 
			tm_now->tm_sec) ;
}

